<script setup>
import {ref,onMounted, toRef, watch} from "vue"
import {loadOml2d} from 'oh-my-live2d'
import { create_live2d } from "@/js/oml2d";
const oml2dRef =ref();
//获取父级传递的参数
const props = defineProps({
  tips:String
})
const tip = toRef(props,'tips')
watch(() => tip.value,(newval)=>{
  console.log(newval);
})
let oml2d;
onMounted(() => {
    //持久化oml2d
    oml2d = create_live2d(oml2dRef.value);
  //获取当前日期具体信息
  //父级传入信息修改tips
    oml2d.onStageSlideIn(async () => {
    await oml2d.tipsMessage(`${tip.value}`,4000,10)
  })
})
</script>
<template>
  <div ref="oml2dRef"></div>
</template>

<style lang="scss" scoped></style>
